<div class="row">
    <div class="col-lg-12">
        <div class="box">
            <div class="box-header">
                <a class="btn btn-app" data-toggle="modal" data-target="#install_add">
                    <i class="fa fa-plus"></i> 添加
                </a>
            </div><!-- /.box-header -->
            <div class="modal fade modal" id="install_add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content table-responsive">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel">添加意向客户</h4>
                        </div>
                        <div class="modal-body">

                            <input class="form-control form-control-solid placeholder-no-fix" type="hidden" id="time" value="<?php echo date("Y-m-d H:i:s"); ?>"/>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        电话
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请输入客户的手机号码" id="mobile"/>
                                </div>
                            </div>


                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        姓名
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请输入客户名字" id="name"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        速率
                                    </div>
                                    <select class="form-control" id="speed">
                                        <option>10M</option>
                                        <option>50M</option>
                                        <option>100M</option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        描述
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请输入跟客户沟通的内容" id="content"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        社区
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请选择安装社区名字" id="addr"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        地址
                                    </div>
                                    <input class="form-control" type="text" autocomplete="off" placeholder="请输入详细地址，没有则不填" id="address"/>
                                </div>
                            </div>

                            <input class="form-control form-control-solid placeholder-no-fix" type="hidden" id="uname" value="<?php echo $_SESSION['uname'];?>"/>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-danger pull-left" data-dismiss="modal">关闭</button>
                            <button type="button" class="btn btn-success pull-right" data-dismiss="modal" onclick="gwbn_not_install_add()">保存</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="box-body">
                <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                    <div class="row">
                        <div class="col-sm-6"></div>
                        <div class="col-sm-6"></div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12 table-responsive">
                            <table class="table table-bordered table-hover dataTable">
                                <thead>
                                <tr role="row">
                                    <th>添加时间</th>
                                    <th>姓名</th>
                                    <th>电话</th>
                                    <th>速率</th>
                                    <th>描述</th>
                                    <th>跟进状态</th>
                                    <th>社区</th>
                                    <th>详细地址</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody align="left">
                                <?php foreach($data['NotInstallList'] as $k){?>
                                    <?php if ($k['start'] == 0 && $k['uname'] === $_SESSION['uname']){?>
                                        <tr>
                                            <td class=""><?php echo $k['time']?></td>
                                            <td class=""><?php echo $k['name']?></td>
                                            <td class=""><?php echo $k['mobile']?></td>
                                            <td class=""><?php echo $k['speed']?></td>
                                            <td class=""><?php echo $k['content']?></td>
                                            <td class="">
                                                <?php $id = $k['entry']; if ($k['List_Num'] != 0){?>
                                                    <!-- Button trigger modal -->
                                                    <button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#not_install_list_<?php echo $id ?>" onclick='not_install_body_list(<?php echo $id ?>)'>
                                                        查看状态 <span class="badge bg-green"><?php echo $k['List_Num'] ?></span>
                                                    </button>
                                                    <!-- Modal -->
                                                    <div class="modal fade modal" id="not_install_list_<?php echo $id ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                                        <div class="modal-dialog modal-lg" role="document">
                                                            <div class="modal-content table-responsive">
                                                                <div class="modal-header">
                                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                                    <h4 class="modal-title" id="myModalLabel">状态列表</h4>
                                                                </div>
                                                                <div class="modal-body">
                                                                    <div class="row">
                                                                        <div class="col-lg-12">
                                                                            <div class="box" style="border-top: 0px;">
                                                                                <div class="box-body">
                                                                                    <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                                                                                        <div class="row">
                                                                                            <div class="col-sm-12">
                                                                                                <table class="table table-bordered table-hover dataTable">
                                                                                                    <thead>
                                                                                                    <tr role="row">
                                                                                                        <td class="sorting">跟进次数</td>
                                                                                                        <td class="sorting">时间</td>
                                                                                                        <td class="sorting">内容</td>
                                                                                                    </tr>
                                                                                                    </thead>
                                                                                                    <tbody id='not_install_body_list_<?php echo $id ?>'>
                                                                                                    </tbody>
                                                                                                    <tfoot>
                                                                                                    <tr role="row">
                                                                                                        <td class="sorting">跟进次数</td>
                                                                                                        <td class="sorting">时间</td>
                                                                                                        <td class="sorting">内容</td>
                                                                                                    </tr>
                                                                                                    </tfoot>
                                                                                                </table>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div><!-- /.box-body -->
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="modal-footer">
                                                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                <?php } else{ echo "暂未跟进";}?>
                                            </td>
                                            <td class="calendar-addr"><?php echo $k['addr']?></td>
                                            <td class="calendar-addr"><?php echo $k['address']?></td>
                                            <td class="calendar-set">
                                                <button type="button" class="btn btn-success btn-xs" onclick='not_install_set("ok",<?php echo $id ?>)'> 完成</button>

                                                <!-- Calendar for set update modal -->
                                                <button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#not_install_set_<?php echo $id ?>"> 跟进</button>

                                                <button type="button" class="btn btn-danger  btn-xs" onclick='not_install_set("del",<?php echo $id ?>)'> 删除</button>

                                                <!-- Calendar for set update Modal -->
                                                <div class="modal fade modal-success" id="not_install_set_<?php echo $id ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                                    <div class="modal-dialog" role="document">
                                                        <div class="modal-content">
                                                            <div class="modal-header">
                                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                                <h4 class="modal-title" id="myModalLabel">跟进信息</h4>
                                                            </div>
                                                            <div class="modal-body">
                                                                <input type="text" class="form-control" placeholder="填写更新内容" id="not_install_content_<?php echo $id ?>" style="height: 100px">
                                                            </div>
                                                            <div class="modal-footer">
                                                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                                                <button type="button" class="btn btn-primary" onclick='not_install_set("set",<?php echo $id ?>)'>保存</button>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        <?php /*endstart*/} /*endforeach*/ }?>
                                </tbody>
                                <tfoot>
                                <tr role="row">
                                    <th>添加时间</th>
                                    <th>姓名</th>
                                    <th>电话</th>
                                    <th>速率</th>
                                    <th>描述</th>
                                    <th>跟进状态</th>
                                    <th>社区</th>
                                    <th>详细地址</th>
                                    <th>操作</th>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div><!-- /.box-body -->
            </div>
        </div>
    </div>
</div>